package io.github.wanggit.antrpc.zipkin.dependencies.schedule;

import io.github.wanggit.antrpc.zipkin.dependencies.service.DependenciesService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class DependencyScheduler {

    @Autowired private DependenciesService dependenciesService;

    /** 首次延迟30s，每 1h 一次 */
    @Scheduled(fixedRate = 1000 * 60 * 60, initialDelay = 1000 * 30)
    public void doIt() {
        dependenciesService.apply(null);
    }
}
